package com.baiwei.vpnapi.exception;

import com.baiwei.vpnapi.handler.MessageSourceHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public enum BusinessEnum {
    PASSWORD_EMPTY(10102, "passwordEmpty"),
    EMAIL_EMPTY(10003, "emailEmpty"),
    EMAIL_FORMAT_ERR(10003, "emailFormatError"),
    USER_REGISTER_EXIST(10003, "userRegExist"),
    USER_LOGIN_NOT_EXIST(10111, "userNotExist"),
    USER_IN_BLACK_LIST(11111, "userInBlackList"),
    USERNAME_LOGIN_EMPTY(10011, "userLoginEmpty"),
    PASSWORD_LOGIN_EMPTY(10012, "pwdLoginEmpty"),
    PASSWORD_LOGIN_WRONG(10013, "pwdLoginError"),
    VPN_SERVER_UPDATED(20000, "vpnServerUpdated"),
    VPN_SERVER_NOT_EXIST(14620, "vpnServerNotExist"),
    VPN_SERVER_ID_EMPTY(10003, "serverIdEmpty"),
    VPN_SERVER_ALLOWEDIP_EMPTY(10002, "noAllowIp"),
    VPN_CONNECT_NOT_EXIST(10000, "deviceNotConnect"),
    VPN_CONNECT_DEVICE_CONNECTED(10003, "deviceHasConnected"),
    VPN_CONFIG_IP_EMPTY(10014, "ipAddrEmpty"),
    VPN_CONFIG_DEVICE_EMPTY(10015, "deviceEmpty"),
    VPN_CONFIG_ERROR(10016, "vpnServerConfigError"),
    VPN_NOT_VALID_PACKAGE(10020, "notAvailablePackage"),
    VPN_CONNECT_COUNT_LIMIT(10000, "connectOverLimit"),
    VPN_FREE_CONNECT_OVERLIMIT(10001, "freeServerOverLimit"),
    PAYMENT_PACKAGE_ID_EMPTY(10000, "packageIdEmpty"),
    PAYMENT_METHOD_EMPTY(10000, "payMethodEmpty"),
    PAYMENT_PACKAGE_NOT_EXIST(10000, "packageNotExist"),
    PAYMENT_METHOD_NOTSUPPORT(10000, "payMethodNotSupport"),
    ADMIN_PUSH_CONTENT_EMPTY(30001, "adminPushContentEmpty"),
    ADMIN_PUSH_TITLE_EMPTY(30002, "adminPushTitleEmpty"),
    ADMIN_PUSH_PLATFORM_EMPTY(30003, "adminPushPlatformEmpty"),
    ADMIN_PUSH_PLATFORM_NOT_SUPPORT(30004, "adminPushPlatformNotSupport"),
    TOKEN_EMPTY(10013, "tokenEmpty"),
    TOKEN_VALID(10014, "tokenInvalid"),
    AUTH_CODE_EXPIRE(10015, "authCodeExpire"),
    AUTH_CODE_NOT_MATCH(10016, "authCodeNotMathc"),
    AUTH_USER_UPDATE_WARNING(30000, "oldUserUpdate"),
    INVITE_CODE_ERROR(30001, "invalidInviteCode"),
    INVITE_EXIST_AT_SAMEDEVICE(30002, "tooManyInvitePerDevice");

    private Integer code;
    private String key;

    public String getMsg() {
        return this.key;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    BusinessEnum(Integer code, String key) {
        this.code = code;
        this.key = key;
    }
}
